<%--
  Created by IntelliJ IDEA.
  User: 周超
  Date: 2019/1/23
  Time: 0:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增商品分类</title>
</head>
<body>
<form id="myform" class="layui-form" action="/AddGoodsClassSubmitServlet" method="post">
    <input id="clId" name="clId" type="hidden" value="">
    <table>
        <tr><td>商品分类名称</td><td><input id="clname" name="clname" type="text" value=""/></td></tr><br>
        <tr><td>父级分类id</td><td><input id="faid" name="faid" type="text" value=""/></td></tr><br>
        <tr><td>商品描述</td><td><input id="clDescribe" name="clDescribe" type="text" value=""/></td></tr><br>
        <tr><td><input id="reset" name="reset" type="reset" value="重置" /></td>
            <td>
                <input  name="sub" type="button" value="提交"  onclick="so()"/>
            </td>
            <td>
                <input  name="sub" type="button" value="取消"  onclick="undo()"/>
            </td>
        </tr><br>
    </table>
</form>
</body>
<script type="text/javascript">
    function so() {
        var clname=document.getElementById("clname").value;
        var faid=document.getElementById("faid").value;
        var clDescribe=document.getElementById("clDescribe").value;
        if(null==clname||""==clname){
            alert("商品名称不能为空！");
            return false;
        }
        if(null==faid||""==faid){
            alert("父级分类id不能为空！");
            return false;
        }
        if(null==clDescribe||""==clDescribe){
            alert("商品分类描述不能为空！");
            return false;
        }
        document.getElementById("myform").submit();
    }

    function undo() {
        window.location.href="../../GoodsClassPageBeanListServlet";
    }
</script>
</html>
